package com.mmy.controller.sys;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.mmy.service.impl.constzone.ConstZoneServiceImpl;
import com.mmy.service.impl.sys.TSysOrgServiceImpl;

@Controller
public class TSysOrgController {
	@Autowired
	TSysOrgServiceImpl tSysOrgServiceImpl;
	@Autowired
	ConstZoneServiceImpl constZoneServiceImpl;

	/**
	 * 函数功能说明： 删除收货信息信息
	 *
	 * @param 参数说明 tSysAddress
	 * @return 返回值说明 jsp页面
	 * @author 创建人 hanxl
	 * @date 创建日期 2020.08.18
	 */
	@PostMapping("/deleteorgchecked")
	@ResponseBody
	public String deleteOrgChecked(String checkList) {
		String[] striOrgIDs = checkList.split(",");
		List<Integer> iOrgIDs = new ArrayList<>();

		for (String striOrgID : striOrgIDs) {
			iOrgIDs.add(Integer.parseInt(striOrgID));
		}

		tSysOrgServiceImpl.deleteChecked(iOrgIDs);

		return "redirect:orgindex";

	}
}
